package com.oxygen.pt.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.oxygen.pt.mapper.TreatmentStatisticsMapper;
import com.oxygen.pt.pojo.entity.TreatmentStatistics;
import com.oxygen.pt.pojo.vo.TreatmentStatisticsVO;
import com.oxygen.pt.service.TreatmentStatisticsService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class TreatmentStatisticsServiceImpl implements TreatmentStatisticsService {

    @Resource
    private TreatmentStatisticsMapper treatmentStatisticsMapper;
    /**
     * 查询当天的当日治疗情况
     */
    @Override
    public TreatmentStatisticsVO getTreatmentStatisticsByDate() {
        TreatmentStatistics treatmentStatistics = treatmentStatisticsMapper.selectByDate(LocalDate.now());
        return BeanUtil.copyProperties(treatmentStatistics, TreatmentStatisticsVO.class);
    }
}
